class ListeningMaterial {
	public title: string;
	public filePath: string;
	public content: string[];
	public translation: string[];
	public soundTime: number;
	public sentenceBreakTimes: number[];
	public sentenceCount: number;
	public level: string;
	public notBlankedWords: number[][];

	public constructor(json?: {}) {
		this.title = json["title"];
		this.filePath = json["filePath"];
		this.soundTime = json["soundTime"];
		this.sentenceCount = json["sentenceCount"];
		this.level = json["level"];
		this.content = (<string>json["content"]).split("\r\n");
		this.translation = (<string>json["translation"]).split("\r\n");
		this.sentenceBreakTimes = [];
		this.notBlankedWords = [];
		let sentenceBreakTimeStrs = (<string>json["sentenceBreakTimes"]).split(",");
		let notBlankedWordStrs = (<string>json["notBlankedWords"]).split(";");
		for (let i = 0; i < this.sentenceCount - 1; i++) {
			this.sentenceBreakTimes[i] = parseInt(sentenceBreakTimeStrs[i]);
			this.notBlankedWords[i] = [];
			if (notBlankedWordStrs[i] != undefined) {
				let notBlankedWordStrss = (<string>notBlankedWordStrs[i]).split(",");
				for (let j = 0; j < notBlankedWordStrs.length; j++) {
					this.notBlankedWords[i][j] = parseInt(notBlankedWordStrss[j]);
				}
			}
		}
	}


}

